package com.api.user.service;
import com.api.user.exception.CoinChangedException;
import com.api.user.exception.CoinNotEnoughException;
import com.api.user.model.CoinTransaction;
import com.api.core.service.Service;
import com.api.core.response.Result;

import java.util.List;
import java.util.Map;

/**
 * Created by wanghuiwen on 2021/03/26.
 */
public interface CoinTransactionService extends Service<CoinTransaction> {
   Result list(String search, String order, Integer page, Integer size);

   /**
    *  用户积分变更
    * @param coinTransaction
    * @return
    */
   Result addOrSub(CoinTransaction coinTransaction);

    Result listUser(Map<String, Object> params, String order, Integer page, Integer size);

    /**
     * 批量交易
     *
     * @param coinTransactions
     * @throws CoinNotEnoughException
     * @throws CoinChangedException
     */
    void batchTransaction(List<CoinTransaction> coinTransactions) throws CoinNotEnoughException, CoinChangedException;
}
